﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HenryNguyen.GNCMedia.ESchool.WebUI.UserControls
{
    public partial class NotificationDialog : System.Web.UI.UserControl
    {
        public string DialogTitle { get; set; }
        public string MessageContent { get; set; }
        public int MessageType { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Hide();
        }

        public void Show()
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "JsModal", "DisplayModal()", true);

            if (MessageType == 0)
            {
                lblError.Visible = true;
                lblSuccess.Visible = false;
                lblError.Text = MessageContent;
            }
            else
            {
                lblError.Visible = false;
                lblSuccess.Visible = true;
                lblSuccess.Text = MessageContent;
            }

            Visible = true;
        }

        public void Hide()
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "JsModal", "RemoveModal()", true);
            Visible = false;
        }
    }
}